import request from '@/utils/request'

const baseUrl = '/prot/exhibition'

export function getExhibitionPage(params) {
  return request({
    url: `${baseUrl}`,
    method: 'get',
    params: params
  })
}

export function getExhibitionById(id) {
  return request({
    url: `${baseUrl}/${id}`,
    method: 'get'
  })
}

export function saveExhibition(exhibition) {
  return request({
    url: `${baseUrl}`,
    method: 'post',
    data: exhibition
  })
}

export function updateExhibition(exhibition) {
  return request({
    url: `${baseUrl}`,
    method: 'put',
    data: exhibition
  })
}
export function deleteExhibitionById(id) {
  return request({
    url: `${baseUrl}/${id}`,
    method: 'delete'
  })
}

export function deleteExhibitionBatch(ids) {
  return request({
    url: `${baseUrl}/batch`,
    method: 'delete',
    params: { ids: ids }
  })
}

export function updateSort(params) {
  return request({
    url: `${baseUrl}/updateSort/${params.exhibitionId}/${params.type}`,
    method: 'put',
  })
}

